import http from '@/utils/request'

export const list = (data) => {
  return http.get('/api/erp/purchase/supplier/erpPurchaseSupplier/list2?commercialType=2', data)
}
export const add = (data) => {
  return http.post('/api/erp/purchase/supplier/erpPurchaseSupplier/add', data)
}
export const edit = (data) => {
  return http.put('/api/erp/purchase/supplier/erpPurchaseSupplier/edit', data)
}

export const supplierSubmit = (data) => {
  return http.get('/api/erp/purchase/supplier/erpPurchaseSupplier/supplierSubmit', data)
}
export const queryById = (data) => {
  return http.get('/api/erp/purchase/supplier/erpPurchaseSupplier/queryById', data)
}
export const submit = (data) => {
  return http.get('/api/erp/purchase/supplier/erpPurchaseSupplier/submit', data)
}
export const deleteData = (data) => {
  return http.delete('/api/erp/purchase/supplier/erpPurchaseSupplier/delete', data)
}

//子表
export const childList = (data) => {
  return http.get('/api/erp/omc/customermanager/erpOmcCustomerManagerContact/allList', data)
}

//撤销
export const revoke = (data) => {
  return http.get('/api/erp/purchase/supplier/erpPurchaseSupplier/revoke', data)
}
//反审
export const counterTrial = (data) => {
  return http.get('/api/erp/purchase/supplier/erpPurchaseSupplier/counterTrial', data)
}
//审核
export const audit = (data) => {
  return http.get('/api/erp/purchase/supplier/erpPurchaseSupplier/audit', data)
}
//驳回
export const overrule = (data) => {
  return http.get('/api/erp/purchase/supplier/erpPurchaseSupplier/overrule', data)
}
//授信
export const editCreditRating = (data) => {
  return http.put('/api/erp/purchase/supplier/erpPurchaseSupplier/editCreditRating', data)
}

//驳回后更新驳回理由字段
export const updateRejectExcuseOne = (data) => {
  return http.put('/api/erp/purchase/supplier/erpPurchaseSupplier/updateRejectExcuseOne', data)
}

//企业名称是否已存在
export const queryByEnterpriseName = (data) => {
  return http.get('/api/erp/purchase/supplier/erpPurchaseSupplier/queryByEnterpriseName', data)
}

//企业信用代码是否已存在
export const queryByEnterpriseCreditCode = (data) => {
  return http.get('/api/erp/purchase/supplier/erpPurchaseSupplier/queryByEnterpriseCreditCode', data)
}

export const addSupplier = (data) => {
  return http.post('/api/erp/purchase/supplier/erpPurchaseSupplier/addSupplier', data)
}

export const editSupplier = (data) => {
  return http.put('/api/erp/purchase/supplier/erpPurchaseSupplier/editSupplier', data)
}


